[idx ,y ,st1val]=find(TLDST1);
[apf,avf,aaf,aph]=size(TLDST1);
apfidx=mod(idx,apf);% index into APFBP vector
cols_t=floor(idx./apf);% columns traversed, if ==0, then idx value = row value, all other idx=1
avfidx=mod(cols_t,avf)+1;% index into AVFBP vector
p2d_t=floor(cols_t/(aaf));%2d pges traversed
aafidx=mod(p2d_t,aaf)+1;
aphidx=floor(p2d_t/avf)+1;
APFBPa=APFBP;
APFBPa(abs(APFBPa)>20)=NaN;
APFBPa(apfidx)

AVFBPa=AVFBP;
AVFBPa(abs(AVFBPa)>20)=NaN;
AVFBPa(avfidx)

AAFBPa=AAFBP;
AAFBPa(abs(AAFBPa)>60)=NaN;
AAFBPa(aafidx)

APHBPa=APHBP;
APHBPa(abs(APHBPa)>.01)=NaN;
APHBPa(aphidx)
